package com.exception.config;

import com.exception.handler.MyExceptionHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;

@Configuration
public class WebMvcConfig {
    @Bean
    public HandlerExceptionResolver myHandlerExceptionResolver() {
        // 注册自定义异常处理类到IOC容器，也可以通过@Component注入
        return new MyExceptionHandler();
    }
}
